﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SMS.Business.Users;

namespace SMS.Account
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void LoginButton_Click(object sender, EventArgs e)
        {
            UsersBusiness userBussiness = new UsersBusiness();
            SMS.DAL.User CurrentUser = userBussiness.UserLogIn(txtUserName.Text, txtPassword.Text);
            if (CurrentUser != null)
            {
                Session["CurrentUser"] = CurrentUser;
                Response.Redirect("../WelcomePage.aspx");
            }
        }

        protected void CustomUserValidator_ServerValidate(object source, ServerValidateEventArgs args)
        {

        }
    }
}
